package com.xiaoming.backend.entity.orm;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class User implements Serializable {
    public static final String MEDICAL = "1";
    public static final String TRANSPORT = "2";
    public static final String HANDLE = "3";
    public static final String ADMIN = "4";
    private Long userId;

    private String userName;

    private String passWard;

    private String name;

    private String role;

    private String roleName;

    private Long facilityId;

    private String facilityName;

    private String avatar;

    private Date crtdDate;

    public void initRole(){
        if (this.role == null){
            return;
        }
        switch (this.role){
            case MEDICAL:
                this.roleName = "医疗人员";
                break;
            case TRANSPORT:
                this.roleName = "运输人员";
                break;
            case HANDLE:
                this.roleName = "处理人员";
                break;
            case ADMIN:
                this.roleName = "超级管理员";
                break;
            default:
                this.roleName = "";
        }
    }
}

